package com.mrx.pvzcommunity.dao;

import com.mrx.pvzcommunity.model.thread.UserThread;
import com.mrx.pvzcommunity.model.user.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserThreadDao {
    @Select("SELECT * FROM threads WHERE uid = #{uid}")
    List<UserThread> findThreadsByUser(User user);

    @Select("SELECT * FROM threads WHERE uid = #{uid}")
    List<UserThread> findThreadsByUserId(@Param("uid") String uid);

    @Select("SELECT * FROM threads WHERE id = #{id}")
    List<UserThread> findThreadsByTid(@Param("id") String tid);
}
